package com.hh.properties;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 不需要addtional-spring-configuration就可以在properties文件中提示了，不過要加spring-boot-configuration-processor包（optinal或compile）
 */
@Data
@Component
@ConfigurationProperties(prefix = "abc")
public class User implements InitializingBean {
    private String userNameAcd;
    private int age;
    private boolean test;
    private Map<String, Object> prop;

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println(this);
    }
}


